/* 1像素解决方案 */
.mix-1px (@top, @right, @bottom, @left, @color) {
  position: relative;

  @scale: 3;

  &:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100% * @scale;
    height: 100% * @scale;
    border: 0 @color solid;
    box-sizing: border-box;
    transform-origin: 0 0;
    transform: scale(1 / @scale);
    pointer-events: none;
    z-index: 0;

    & when (@top > 0) {
      border-top-width: 1px;
    }

    & when (@right > 0) {
      border-right-width: 1px;
    }

    & when (@bottom > 0) {
      border-bottom-width: 1px;
    }

    & when (@left > 0) {
      border-left-width: 1px;
    }
  }
}

/*
 * 清除1px
 */
.mix-1px-clear () {
  &:before {
    display: none;
  }
}

/*
 * 清除浮动
 */
.mix-clearfix () {
  &:before,
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

/*
 * mobile
 */
 
 .setTapColor(@c:rgba(0,0,0,0)) {
  -webkit-tap-highlight-color: @c;
}

/*
 * 1px
 */
.setTopLine(@c: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;
  border-top: 1px solid @c;
  color: @c;
  transform-origin: 0 0;
  transform: scaleY(0.5);
}

.setBottomLine(@c: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  height: 1px;
  border-bottom: 1px solid @c;
  color: @c;
  transform-origin: 0 100%;
  transform: scaleY(0.5);
}

.setLeftLine(@c: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  bottom: 0;
  border-left: 1px solid @c;
  color: @c;
  transform-origin: 0 0;
  transform: scaleX(0.5);
}

.setRightLine(@c: #C7C7C7) {
  content: " ";
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  bottom: 0;
  border-right: 1px solid @c;
  color: @c;
  transform-origin: 100% 0;
  transform: scaleX(0.5);
}

/*
 * text
 */
.ellipsis(@w:auto) {
  width: @w;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-wrap: normal;
}

.ellipsisLn(@line) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: @line;
}

.text_wrap() {
  word-wrap:break-word;
  word-break:break-all;
}

.hyphens() {
  word-wrap:break-word;
  -webkit-hyphens:auto;
  hyphens:auto;
}

.flex-center() {
  display: flex;
  justify-content: center;
  align-items: center;
}

.circle (@width) {
  width: @width;
  height: @width;
  border-radius: 50%;
  .flex-center();
}


/* 垂直居中 */
.mix-flex-y-center () {
  display: flex;
  align-items: center;
}

/* 水平居中 */
.mix-flex-x-center () {
  display: flex;
  justify-content: center;
}

/* 水平垂直居中 */
.mix-flex-center () {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 超出部分出省略号 */
.mix-text-overflow () {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
/* 多行文本超出部分省略号 */
.ellipsis-line(@line:2) {
  display: -webkit-box;
  text-overflow: ellipsis;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: @line;
  box-orient: vertical;
}